using System;
using System.Windows.Forms;
using System.Threading;

namespace Logger
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            /*Issue 14: Avoid multiple instances */
            using (Mutex mutex = new Mutex(false, "Global\\" + "B1ABDB7A-DF8F-48c0-BCFA-933431D8B11F"))
            {
                if (!mutex.WaitOne(0, false))
                {
                    MessageBox.Show("Instance already running","Logger",MessageBoxButtons.OK,MessageBoxIcon.Error);
                    return;
                }
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new MainForm());
            }
        }
    }
}